﻿<Window x:Class="Wpf2.Views.ManagePassword"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:ViewModels="clr-namespace:Wpf2.ViewModels"
        Title="Quản lý người dùng" Height="350" Width="600">
    <Window.DataContext>
        <ViewModels:ViewModelUser></ViewModels:ViewModelUser>
    </Window.DataContext>
   
    <StackPanel Margin="5,5,5,5" Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Top">
        <DataGrid x:Name="dtgDanhmuc" Height="300" SelectionUnit="FullRow"  CanUserAddRows="True" SelectionMode="Single" AutoGenerateColumns="False" ItemsSource="{Binding ListUsers}"   AlternatingRowBackground="PaleTurquoise"  CellEditEnding="DtgDanhmucCellEditEnding" RowEditEnding="dtgDanhmuc_RowEditEnding">
     

            <DataGrid.RowHeaderTemplate >
                <DataTemplate>
                    <TextBlock  Width="20" Text="{Binding Header, RelativeSource={RelativeSource AncestorType={x:Type DataGridRow}, Mode=FindAncestor}}"/>
                </DataTemplate>
            </DataGrid.RowHeaderTemplate>
            <DataGrid.Columns>
                <DataGridTextColumn Header="Mã" Visibility="Hidden"  Width="10"  Binding="{Binding UserIdAuto,UpdateSourceTrigger=PropertyChanged}"/>
                <DataGridTextColumn Header="Mã người dùng"  Width="100"  Binding="{Binding UserId,UpdateSourceTrigger=PropertyChanged}"/>
                <DataGridTextColumn Header="Tên người dùng" Width="300"  Binding="{Binding UserName,UpdateSourceTrigger=PropertyChanged}"/>
                <DataGridTextColumn Header="Mật khẩu" Width="100" Binding="{Binding Password,UpdateSourceTrigger=PropertyChanged}"/>
               <!-- <DataGridTemplateColumn>
                    <DataGridTemplateColumn.CellTemplate>
                        <DataTemplate>
                            <Button x:Name="btnDelete" Width="50" Background="{x:Null}"  >
                                <StackPanel Orientation="Horizontal">
                                    <Image Source="/Wpf2;component/Images/delete.png" Width="20" Height="20"/>
                                    <TextBlock Text="Xóa" VerticalAlignment="Center" Margin="2,0,0,0"/>
                                </StackPanel>
                            </Button>
                        </DataTemplate>
                    </DataGridTemplateColumn.CellTemplate>
                </DataGridTemplateColumn>-->
            </DataGrid.Columns>
        </DataGrid>
    </StackPanel>
</Window>
